#include <iostream>
#include <algorithm>
using namespace std;
const int N = 2e5 + 10;
typedef long long LL;
int n, m;
struct node{
    int num;
    LL x;
}a[N];
bool cmp(node& a, node& b)
{
    return a.x > b.x;
}
int main()
{
    cin >> n >> m;
    for(int i = 1; i <= n; i++) 
    {
        cin >> a[i].x;
        a[i].num = 1; // row
    }
    for(int i = n + 1; i <= n + m; i++) 
    {
        cin >> a[i].x;
        a[i].num = 0; // col
    }
    sort(a + 1, a + 1 + n + m, cmp);
    int row = n, col = m;
    LL sum = 0;
    int i = 1;
    while(row > 0 && col > 0)
    {
        LL x = a[i].x;
        int num = a[i].num;
        if(num) // row
        {
            sum += x * col;
            row--;
        }
        else // col
        {
            sum += x * row;
            col--;
        }
        i++;
    }
//     cout << row << " " << col << endl;
    cout << sum << endl;
    return 0;
}